home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / lisp / kcl / akcl / akcl1615.lha / lsp / gprof1.lisp < prev    next >
Lisp/Scheme  |  1989-05-14  |  1KB  |  54 lines

  1. (in-package 'si)
  2.  
  3. ;;  (load "gprof.o")
  4. ;;  On a sun in sun0S 3 or 4.0
  5. ;;  make a modified copy of /lib/gcrt0.o called gcrt0-mod.o
  6. ;;  then (cd unixport ; make "EXTRAS=../lsp/gcrt0-mod.o")
  7. ;;  after compiling some .o files with
  8. ;;  (cd o ; make  "CFLAGS = -I../h -pg -g -c")
  9. ;;   (invoke gprof-setup)
  10. ;;  and (monitor #x800 3000000)
  11. ;;  (monitor 0 0) to start and stop respectively
  12. ;; on suns the buffersize = (highpc- lowpc)/2   +6
  13.  
  14.  
  15. (clines "#include \"gprof.hc\"")
  16.  
  17. (defun gprof-setup (&optional (n 800000) (m 1000000))
  18.    (mymonstartup #x800 n)
  19.    (set-up-monitor-array m)
  20. (format t"   ;;  and (monitor #x800 3000000)
  21.    ;;  (monitor 0 0) to start and stop respectively
  22.     ")
  23.    nil)
  24.  
  25. (defentry mymonstartup (int int) (int "mymonstartup"))
  26. ;(defentry monitor1 (int int object) (int "mymonitor"))
  27. (defentry monitor2 (int int int int) (int "mymonitor"))
  28.  
  29. (defentry write_outsyms () (int "write_outsyms"))
  30.  
  31. (defvar *monitor-array* nil)
  32.  
  33. (defun set-up-monitor-array (&optional (n 1000000))
  34.   (unless *monitor-array* (setf *monitor-array*
  35.                 (make-array n :element-type 'string-char
  36.                         :static t))
  37.       ;(mymonstartup 0 2000000)
  38.       nil
  39.       ))
  40.  
  41. (defun monitor (low high)
  42.   (monitor1 low high *monitor-array*))
  43.  
  44. (defun write-syms.out ()
  45.   (set-up-combined)
  46.   (write_outsyms))
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.